package geodata;

import java.io.Serializable;
import java.util.Vector;

/**
 * @author Sean Freitag
 * Interface for all related GeoData's
 */
@SuppressWarnings("serial")
public abstract class GeoData implements Serializable
{
	/**
	 * 
	 */
	private Vector<Field<? extends Number>> fields;
	
	/**
	 * 
	 */
	public GeoData()
	{
		fields = new Vector<Field<? extends Number>>();
	}
	
	/**
	 * @param field the field to add to the list of fields in the GeoData class
	 */
	protected void addField(Field<? extends Number> field)
	{
		fields.add(field);
	}
	
	public Field<? extends Number> getFieldByName(String name)
	{
		for(Field<? extends Number> field : fields)
		{
			if(field.getDisplayName().equals(name))
				return field;
		}
		
		return null;
	}
	
	/**
	 * In a future iteration, will change units to Metric
	 */
	public abstract void setMetric();
	
	/**
	 * In a future iterator, will change units to Standard
	 */
	public abstract void setStandard();
	
}
